#*-*coding=utf-8*-*


import model.Variable as Variable
class VariablesManager(object):
    '''
    Stores the variables retrieved in the template file
    '''
    def __init__(self,rawVars):
        '''
        Create the variables container that is a list of Variable Object
        param : rawVars, a dictionnary filled with rawString Variable with this format name:defaultvalue
        '''
        self.vars = []
        self._parseVariables(rawVars)
        #print self.vars[0]
        
    def _parseVariables(self,rawVars):
        '''
        fill the array self.vars with instances of Variable class
        '''
        for rvar in rawVars :
            self.vars.append(Variable.Variable(rvar))
    def __str__(self):
        '''
        str representation of the variable heap
        '''
        s = ""
        for v in self.vars :
            s += str(v) + "\n"
        return s
